home *** CD-ROM | disk | FTP | other *** search
/ SGI Developer Toolbox 6.1 / SGI Developer Toolbox 6.1 - Disc 4.iso / src / haeberli / libgutil / resource.c < prev    next >
C/C++ Source or Header  |  1994-08-01  |  2KB  |  84 lines

  1. /*
  2.  * Copyright 1991, 1992, 1993, 1994, Silicon Graphics, Inc.
  3.  * All Rights Reserved.
  4.  *
  5.  * This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics, Inc.;
  6.  * the contents of this file may not be disclosed to third parties, copied or
  7.  * duplicated in any form, in whole or in part, without the prior written
  8.  * permission of Silicon Graphics, Inc.
  9.  *
  10.  * RESTRICTED RIGHTS LEGEND:
  11.  * Use, duplication or disclosure by the Government is subject to restrictions
  12.  * as set forth in subdivision (c)(1)(ii) of the Rights in Technical Data
  13.  * and Computer Software clause at DFARS 252.227-7013, and/or in similar or
  14.  * successor clauses in the FAR, DOD or NASA FAR Supplement. Unpublished -
  15.  * rights reserved under the Copyright Laws of the United States.
  16.  */
  17. /*
  18.  *    resource -
  19.  *        Make it very very easy to use cursors, patterns, and bitmaps.
  20.  *
  21.  *                Paul Haeberli - 1986
  22.  */
  23. #include "bitmap.h"
  24. #include "stdio.h"
  25.  
  26. rescursor(name)
  27. char *name;
  28. {
  29.     Bitmap *bm;
  30.  
  31.     bm = bmread(name);
  32.     if(!bm)
  33.     return;
  34.     if(bm->xsize != 16 && bm->ysize != 16) {
  35.     fprintf(stderr,"rescursor: cursor must be 16x16\n");
  36.     return;
  37.     }
  38.     defcursor(200,bm->base);
  39.     curorigin(200,bm->xorig,bm->yorig);
  40.     setcursor(200);
  41.     bmfree(bm);
  42. }
  43.  
  44. respattern(name)
  45. char *name;
  46. {
  47.     Bitmap *bm;
  48.     int xsize, ysize;
  49.  
  50.     bm = bmread(name);
  51.     if(!bm)
  52.     return;
  53.     xsize = bm->xsize;
  54.     ysize = bm->xsize;
  55.     if(xsize != 16 && xsize != 32 && xsize != 64) {
  56.     fprintf(stderr,"respattern: patterns must be 16x16 or 32x32 or 64x64\n");
  57.     return;
  58.     }
  59.     if(xsize != ysize) {
  60.     fprintf(stderr,"respattern: patterns must be square\n");
  61.     return;
  62.     }
  63.     defpattern(200,xsize,bm->base);    
  64.     setpattern(200);
  65.     bmfree(bm);
  66. }
  67.  
  68. resbitmap(name)
  69. char *name;
  70. {
  71.     Bitmap *bm;
  72.  
  73.     bm = bmread(name);
  74.     if(!bm)
  75.     return;
  76.     mydrawbitmap(bm);
  77.     bmfree(bm);
  78. }
  79.  
  80. reslinestyle(name)
  81. char *name;
  82. {
  83. }
  84.